<template>
	<view class="appraisal_wrap">
		<y-navbar title="测评" :showLeft="false"></y-navbar>
		<u-button type="primary" size="medium" @click="uploadFile">上传附件</u-button>		
		<y-caledar />	
		<u-button @click="toVideo" type="primary">看短视频</u-button>
	</view>
</template>

<script>
	export default {
		mounted() {
			this.dispose()
		},
		methods: {
			uploadFile() {
				uni.chooseFile({
					count: 1,
					type: 'all',
					extension: ['.excel','.doc'],
					success (res) {
						// tempFilePath可以作为img标签的src属性显示图片
						const tempFilePaths = res.tempFiles
					}
				})
			},
			
			toVideo() {
				uni.navigateTo({
					url: '/pages/video/index'
				})
			},
			
			dispose() {
				let arr = [
					{name: '不限'},
					{name: '在校/应届'},
					{name: '1年以内'},
					{name: '1-3年'},
					{name: '3-5年'},
					{name: '5-10年'},
					{name: '10年以上'}
				]
				let arr2 = ["10年以上", "5-10年", '在校/应届']
				let newArr = []
				
				arr.forEach((item, index) => {
					arr2.forEach((item2) => {
						if(item2 == item.name) {
							newArr.splice(index, 0, item2)
						}
					})
				})
				console.log(newArr)
			}
		}
	}
</script>

<style scoped lang="scss">
	.appraisal_wrap {
		/* #ifdef APP-PLUS */
			margin-top: 60rpx;
		/* #endif */
	}
</style>
